import http from "@/api/http";

/**
 * 日志服务类
 */
export class LogService {
    /**
     * 获取登录日志列表
     * @param query
     * @returns {Promise<AxiosResponse<any>>}
     * @constructor
     */
    static GetLoginLogLists(query) {
        return http({
            url: '/api/login_log/lists',
            data: query,
            method: 'post'
        })
    }

    /**
     * 清空登录日志
     * @returns {Promise<AxiosResponse<any>>}
     * @constructor
     */
    static ClearAllLoginLog() {
        return http({
            url: '/api/login_log/clear_login_log',
            method: 'post'
        })
    }

    /**
     * 获取操作日志列表
     * @param query
     * @returns {Promise<AxiosResponse<any>>}
     * @constructor
     */
    static GetOperLogLists(query) {
        return http({
            url: '/api/oper_log/lists',
            data: query,
            method: 'post'
        })
    }

    /**
     * 获取操作日志详情
     * @param query
     * @returns {Promise<AxiosResponse<any>>}
     * @constructor
     */
    static GetOperLogDetailById(query) {
        return http({
            url: '/api/oper_log/detail',
            data: query,
            method: 'post'
        })
    }

    /**
     * 清空操作日志
     * @returns {Promise<AxiosResponse<any>>}
     * @constructor
     */
    static ClearAllOperLog() {
        return http({
            url: '/api/oper_log/clear_oper_log',
            method: 'post'
        })
    }
}
